package whf.framework.ext.dao;

import java.util.List;
import java.util.Map;

import whf.framework.exception.FindException;
import whf.framework.ext.entity.Category;
import whf.framework.util.Utils;

/**
 * @author wanghaifeng
 * @email king@126.com
 * @modify 2006-06-16
 */
public class CategoryDAOImp extends whf.framework.dao.DAOImp<Category> implements CategoryDAO {
	public List<Category> findCategories(Category parent) throws FindException{
		if(parent == null){
			return super.find("");
		} else {
			Map<String, Object> map = Utils.newHashMap();
			map.put("parent", parent);
			return super.findByProperties(map,0,Integer.MAX_VALUE);
		}
	}
} 